package com.woniu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 充电卡表
 * @TableName charging_card
 */
@TableName(value ="charging_card")
@Data
public class ChargingCard implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 充电卡编号
     */
    private String cardNumber;

    /**
     * 客户表id
     */
    private Long customerId;

    /**
     * 开卡时间
     */
    private Date openCardTime;

    /**
     * 卡内金额
     */
    private BigDecimal cardBalance;

    /**
     * 会员等级
     */
    private Integer membershipLevel;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 备注
     */
    private String remarks;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ChargingCard other = (ChargingCard) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCardNumber() == null ? other.getCardNumber() == null : this.getCardNumber().equals(other.getCardNumber()))
            && (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
            && (this.getOpenCardTime() == null ? other.getOpenCardTime() == null : this.getOpenCardTime().equals(other.getOpenCardTime()))
            && (this.getCardBalance() == null ? other.getCardBalance() == null : this.getCardBalance().equals(other.getCardBalance()))
            && (this.getMembershipLevel() == null ? other.getMembershipLevel() == null : this.getMembershipLevel().equals(other.getMembershipLevel()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCardNumber() == null) ? 0 : getCardNumber().hashCode());
        result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
        result = prime * result + ((getOpenCardTime() == null) ? 0 : getOpenCardTime().hashCode());
        result = prime * result + ((getCardBalance() == null) ? 0 : getCardBalance().hashCode());
        result = prime * result + ((getMembershipLevel() == null) ? 0 : getMembershipLevel().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", cardNumber=").append(cardNumber);
        sb.append(", customerId=").append(customerId);
        sb.append(", openCardTime=").append(openCardTime);
        sb.append(", cardBalance=").append(cardBalance);
        sb.append(", membershipLevel=").append(membershipLevel);
        sb.append(", status=").append(status);
        sb.append(", remarks=").append(remarks);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}